﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Controller;
using System.IO;

namespace CodeFactory
{
    public partial class Options : Form
    {
        private OptionBO _opBO;
        public OptionBO opBO
        {
            get
            {
                if (_opBO == null)
                    _opBO = FactoryControllerBO.CurrentFA.CreateOptionBOInstance();
                return _opBO;

            }
        }


        #region 初始化
    
        public Options()
        {
            InitializeComponent();
        }


        private void Options_Load(object sender, EventArgs e)
        {

        }

        #endregion

        #region 私有方法

        private void InitializeProjectPathPanel()
        {
            txtProjectPath.Text = opBO.GetProjectPath();
        }

        #endregion


        #region 按钮事件

        private void btnProjectPath_Click(object sender, EventArgs e)
        {
            folderBrowserDialogProjectPath.ShowDialog();
            txtProjectPath.Text = folderBrowserDialogProjectPath.SelectedPath;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        

        #endregion

        private void btnOK_Click(object sender, EventArgs e)
        {
            #region ProjectPath
            
             if(!String.IsNullOrEmpty(txtProjectPath.Text.Trim()))
             {
                 if (!Directory.Exists(txtProjectPath.Text.Trim()))
                 {
                     Directory.CreateDirectory(txtProjectPath.Text.Trim());
                 }
             }




            #endregion
        }


        #region Panel状态管理



        #endregion


      
    }
}
